package lab02.Test34;
import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
 * Created by Administrator on 2017/11/14.
 */
public class Test {
    public static void main(String[] args) {
        String b[]=new String[4];
        List<String> list = new ArrayList<>();
        list.add(b[0]="apple");
        list.add(b[1]="grape");
        list.add(b[2]="banana");
        list.add(b[3]="pear");
        Collections.sort(list, Collator.getInstance(java.util.Locale.CHINA));
        for (int a = 0; a < list.size(); a++) {
            System.out.println(list.get(a));
        }
        String s=b[0],z=b[0];
        for (int c=1;c<4;c++){
            if (s.length()<b[c].length())
            {
                s=b[c];
            }
            else {
                z=b[c];
            }
        }
        System.out.println("最大值为"+s+","+"最小值为"+z);
    }
}
